import 'dart:io';
import 'package:flutter/material.dart';

ThemeData createThemeData(Brightness brightness, Color primaryColor) {
  return ThemeData(
    brightness: brightness,
    colorScheme: brightness == Brightness.light
        ? ColorScheme.light(
            surface: Colors.grey.shade200,
            onSurface: Colors.grey.shade900,
            primary: primaryColor,
            primaryContainer: Colors.white,
            secondary: Colors.grey.shade300,
            inversePrimary: Colors.grey.shade800,
            shadow: const Color.fromARGB(112, 80, 80, 80),
          )
        : ColorScheme.dark(
            surface: const Color.fromARGB(255, 39, 39, 42),
            onSurface: Colors.grey.shade100,
            primary: primaryColor,
            primaryContainer: const Color.fromARGB(255, 31, 32, 33),
            secondary: const Color.fromARGB(107, 66, 66, 66),
            inversePrimary: Colors.grey.shade200,
            shadow: const Color.fromARGB(111, 201, 201, 201),
          ),
    fontFamily: Platform.isWindows ? "Microsoft YaHei" : null,
  );
}

ThemeData lightMode = createThemeData(Brightness.light, Colors.blueAccent);
ThemeData darkMode = createThemeData(Brightness.dark, Colors.blueAccent);
